Python NumPy block Function Example by using np.eye function

53

# welcome to softhunt.net
# import numpy as np
import numpy as np   
A = np.eye(2) * 2
B = np.eye(3) * 3
C = np.block([[A, np.zeros((2, 3))],[np.ones((3, 2)), B ]])
print(C)

Comments

Submit
0 Comments